package com.sinven.controller;

import com.sinven.pojo.SinglePage;
import com.sinven.service.SinglePageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller("frontSingle")
@RequestMapping("major")
public class SinglePageController {

    @Autowired
    private SinglePageService pageService;

    @RequestMapping("{code}")
    public String page(@PathVariable("code")String code, Model model){
        SinglePage singlePage = pageService.queryPage(code);
        model.addAttribute("page",singlePage);
        return "major";
    }
}
